package com.hollycrm.unicom.sheet.define;

import com.hollycrm.unicom.common.*;
/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: Hollycrm</p>
 * @author not attributable
 * @version 1.0
 */

public class ClassTreeViewObject extends TreeViewObject{

  private String classID;

  public ClassTreeViewObject(String classID, String id, String name,
                             String isLeaf,
                             int level) {
      this.classID = classID;
      super.id = classID;
      super.name = name;

      if ("1".equals(isLeaf)) {
          super.type = TreeViewObject.NO_SUB_NODE;
      }
      else {
          super.type = TreeViewObject.HAS_SUB_NODE;
      }

      super.level = level;
  }


  public int hashCode() {
      return id == null ? super.hashCode() : id.hashCode();
  }

  public boolean equals(Object o) {
      return o instanceof ClassTreeViewObject && id != null &&
          id.equals( ( (ClassTreeViewObject) o).getId());
  }

  public String getClassID() {
      return classID;
  }

  public void setClassID(String classID) {
      this.classID = classID;
  }

}